import {lazy, Suspense} from "react";
import { createBrowserRouter } from "react-router-dom";
import Layout from '../pages/Layout/index.tsx';
import Login from '../pages/Login/index.tsx';
import NotFound from "../pages/404";
const Home = lazy(() => import('../pages/Home'));
// import {AuthRoute} from "../components/AuthRoute.tsx";
// 配置路由实例
const router = createBrowserRouter([
    {
        path: '/',
        // element: <AuthRoute> <Layout /></AuthRoute>,
        element:  <Layout />,
        children:[
            {
                index:true,
                // path:'home',
                element: <Suspense fallback={'加载中'}><Home/></Suspense>
            },
        ]
    },
    {
        path:'/login',
        element:<Login/>
    },
    {
        path:'*',
        element:<NotFound/>
    }
]);
export default router;